package com.example.hanchen.yongkanggy.home.activity;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.example.hanchen.yongkanggy.R;
import com.example.hanchen.yongkanggy.entity.StatusCode;
import com.example.hanchen.yongkanggy.utils.PreferencesUtil;
import com.example.hanchen.yongkanggy.utils.SharePreferencesConsts;

public class WelcomeScreenActivity extends AppCompatActivity {
    StatusCode statusCode;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_welcome_screen);
        gotoMain();
    }



    public void gotoMain() {
        statusCode = PreferencesUtil.getObject(SharePreferencesConsts.LOGINSMS, StatusCode.class);
        if (statusCode != null && !TextUtils.isEmpty(statusCode.getData().getTokenValue())) {
            startActivity(new Intent(this, HomeActivity.class));
        } else {
            startActivity(new Intent(this, LoginActivity.class));
        }
    }
}